﻿using System;
using System.Windows.Controls;
using System.Windows.Interactivity;

namespace Orktane.Behaviors
{
    public class PlayMediaElementAction 
        : TargetedTriggerAction<MediaElement>
    {
        protected override void Invoke(object parameter)
        {
            if (this.Target == null) return;
            //this.Target.Stop();
            this.Target.Position = TimeSpan.Zero;  // this is to reset its position
            this.Target.Play();
        }
    }
}
